<template>
	<view class="home">
		<!--#ifdef MP-WEIXIN-->
		<view class="top_banner" v-if="homeInfo.is_notice==1">
			<view>
				立刻开启消息，获得收益，奖品通知
			</view>
			<view @click="subscribeNews">
				开启消息
			</view>
		</view>
		<!--#endif-->
		<view class="person-bg-img">
			<view class="home-person">
				<view class="person-msg">
					<view class="person-level">
						<view class="person-img" v-if="avatarUrl != ''">
							<image :src="avatarUrl"></image>
							<text v-if="homeInfo.is_captain==1">队</text>
						</view>
						<view class="empirical-value" v-if="nickName != ''">
							<view class="empirical">
								<view class="botline">
									<view class="topline" :style="{width:width + '%'}"></view>
								</view>
								<text>{{homeInfo.user_achievement_value}}/{{homeInfo.next_level_achievement_value}}</text>
							</view>
							<view class="level" v-if="homeInfo.grade">
								{{homeInfo.grade}}
							</view>
						</view>
						<view class="no-login" v-else>
							<view></view>
							<!--#ifdef H5-->
							<button class='bottom' @click="getuserinfo">
								请先登录
							</button>
							<!--#endif-->
							<!--#ifdef MP-WEIXIN-->
							<button class='bottom' open-type="getUserInfo" withCredentials="true" lang="zh_CN" @getuserinfo="getuserinfo">
								请先登录
							</button>
							<!--#endif-->

						</view>
					</view>
					<view class="light-city">
						<text  @click="getrulePopup">成就值说明</text> 
					</view>
					<uni-popup ref="popupWelcomeone" :custom="true">
                     	<view class="popup_box_de">
                     		<!-- <image class="popup_box_close" :src="clearPng" @click="popupClose"></image> -->
                     		<view class="popup_box_content">
                     			<view class="popup_box_img">
                     				<image :src="gift_new_img" style="width: 68upx;height: 68upx;"></image>
                     				<view style="margin-left: 18upx;">盘古</view>
                     			</view>
                     			<view class="popup_box_welcome">
                     				<view></view>
                     				<view>
                     					<text>
                     					<text style="color: #FFE500;align-self: flex-start;" v-if="nickName">{{nickName}}</text>
                     					<text style="color: #FFE500;align-self: flex-start;" v-else>你好</text>，{{homeInfo.news.welcome_message}}
                     					</text>
                     				</view>
                     			</view>
                     			<view class="popup_box_prepare">
                     				<view class="popup_box_contain">
                     					<view class="popup_box_prepare_title">
                     						点亮地球，特意为你准备了
                     					</view>
                     					<view class="popup_box_prepare_gift">
                     						<view>
                     							<image class="popup_box_image" :src="crown"></image>
                     							<text class="popup_box_prepare-num">{{homeInfo.news.achievement_value}}</text>
                     							<text class="popup_box_prepare-think">成就值</text>
                     						</view>
                     						<view>
                     							<image class="popup_box_image" :src="gift_kindling"></image>
                     							<text class="popup_box_prepare-num" style="font-size:28upx;text-align:center;">{{homeInfo.news.grade}}</text>
                     							<text class="popup_box_prepare-think">火种</text>
                     						</view>
                     						<view>
                     							<image class="popup_box_image" :src="gift_money"></image>
                     							<text class="popup_box_prepare-num">{{homeInfo.news.red_envelope}}</text>
                     							<text class="popup_box_prepare-think">现金红包</text>
                     						</view>
                     					</view>
                     				</view>
                     			</view>
								<view></view>
								<!--#ifdef H5-->
								<button class='bottom' @click="getuserinfo">
									接受挑战
								</button>
								<!--#endif-->
								<!--#ifdef MP-WEIXIN-->
								<button class="popup_box_prepare_receive" open-type="getUserInfo" withCredentials="true" lang="zh_CN" @getuserinfo="getuserinfo">
									接受挑战
								</button>
								<!--#endif-->
                     			<view class="xieyi" @click="toMember">
                     				接受挑战就代表同意<text style="color: #00A66A;">《用户协议》</text>
                     			</view>
                     		</view>
                     	</view>
                     </uni-popup>
				</view>
				<view class="person-main">
					<view class="video-gift" v-if="!hasLogin">
						<!-- <view class="video">
							<view class="video-img">
								<image :src="videoImg" style="width: 20upx;height: 12upx;display: block;margin-left: 36upx;"></image>
								<text style="font-size: 30upx;color: #00A66A;margin-left: 18upx;">100</text>
							</view>
							<view class="video-text" style="color: #00A66A;font-size: 24upx;text-align: center;">
								看视频
							</view>
						</view> -->
						<button style="background-color:#fff;margin-top:152upx;line-height:1.3;" class="gift" open-type="getUserInfo" withCredentials="true" lang="zh_CN" @getuserinfo="getNewGift">
							<view class="gift-img">
								<image :src="new_gift" style="width: 40upx;height: 40upx;margin: 0 auto;display: block;"></image>
							</view>
							<view class="gift-text" style="color: #00A66A;font-size: 24upx;text-align: center;">
								新人礼包
							</view>
						</button>
					</view>
					<view class="person-achievement">
						<view style="font-size: 24upx;">
							我的成就值
						</view>
						<view style="font-size: 96upx;font-family: DINOT-Bold;margin-bottom: 16upx;">
							{{homeInfo.user_achievement_value}}
						</view>
						<!--#ifdef H5-->
						<button style="line-height:1.6;color:#fff;font-size:24upx;margin-bottom:16upx;background-color:transparent;" 
						@click="gotoPage('../myWorld/myWorld')">查看成就收益
						</button>
						<!--#endif-->
						<!--#ifdef MP-WEIXIN-->
						<button style="line-height:1.6;color:#fff;font-size:24upx;margin-bottom:16upx;background-color:transparent;" open-type="getUserInfo" withCredentials="true" lang="zh_CN" @getuserinfo="toMyWorld">
							查看成就收益
						</button>
						<!--#endif-->						
						<view style="font-size: 24upx;" v-if="showTime">
							<text>{{nowTime}}</text>
						</view>
						<view style="height: 32upx;" v-else>
						</view>
					</view>
					<!--#ifdef MP-WEIXIN-->
					<button style="background-color:transparent;line-height:1.3;" v-if="homeInfo.is_run==1" class="step-number" open-type="getUserInfo" withCredentials="true" lang="zh_CN" @getuserinfo="addStepNum">
						<view class="gift-img" style="margin:0 auto;font-size:30upx;">
							<text style="display: inline-block;margin-left:20upx;">100</text>
						</view>
						<view class="gift-text" style="color: #00A66A;font-size: 24upx;text-align: center;">
							每天走完3000步可领
						</view>
					</button>
					<!--#endif-->
					
				</view>
				<view class="invite-new">
					<button open-type="share" @click="open_share_tip" style="background-color:#fff;" class="gain-Achievement">
						<view>
							邀请好友得<text style="font-size: 40upx;color:#FF3C00;">{{invite1_achievement_value}}</text>成就值
						</view>
					</button>
					<view class="enjoy-privilege" v-if="homeInfo.is_captain==0">
						招募<text style="color: #FF3C00;">{{inviteNum}}位</text>队员升级为队长，享受队长特权
					</view>
				</view>
				
			</view>
		</view>
		<!-- 金榜题名与每日解谜 -->
		<view class="riddle-nominate">
			<!-- 每日解谜 -->
			<button class="riddle" open-type="getUserInfo" withCredentials="true" lang="zh_CN" @click="riddleClick" >
				<view class="riddle-title">每日解谜</view>
				<view class="riddle-time">
					
				</view>
				<!--<view class="riddle-time" >
					<text>{{rH}}</text>:<text>{{rF}}</text>:<text>{{rS}}</text>
				</view> -->
               
				<view class="suspend">
					<image class="riddle-nominate-img" :src="lucky_bag"></image>
					<view class="suspend-title">
						随机红包
					</view>
				</view>
				<view class="riddle-congratulate riddle-congratulateone">解谜成功 欢抢福袋</view>
				<view class="riddle-person riddle-personone">已有<text style="color: #00A66A;">{{homeInfo.qian}}</text>人抢到福袋</view>
			</button>
			<!-- 金榜题名 -->
			<button class="riddle" @click="topNominateClick">
				<view class="riddle-title">金榜题名</view>
				<view class="riddle-time">
					每天6点-22点
				</view>
				<view class="suspend">
					<image class="nominate-img" :src="nomination"></image>
					<view class="suspend-title suspeend-titleone">
						等你来战
					</view>
				</view>
				<view class="riddle-congratulate">金榜题名 赢取奖品</view>
				<view class="riddle-person">已有<text style="color: #00A66A;">{{homeInfo.canjia}}</text>人上榜拿到奖励</view>
			</button>
            <!--  团好课 -->
			<!--#ifdef H5-->
			<button class="riddle"  @click="preImg('/static/thk_code.jpg')">
				<view class="riddle-title">团好课</view>
				<view class="suspend">
					<image class="Massofgoodlesson-img" src="../../static/Massofgoodlesson.png"></image>
					
				</view>
				<view class="Massofgoodlessonteacher riddle-congratulateone">周边名师好课</view>
				
			</button>
			<!--#endif-->
			<!--#ifdef MP-WEIXIN-->
			<button class="riddle"  @click="Massofgoodlesson">
				<view class="riddle-title">团好课</view>
				<view class="suspend">
					<image class="Massofgoodlesson-img" src="../../static/Massofgoodlesson.png"></image>
					
				</view>
				<view class="Massofgoodlessonteacher riddle-congratulateone">周边名师好课</view>
				
			</button>
			<!--#endif-->
			
         
		</view>
		
		<!-- 小幸运 -->
		<view class="home-lucky">
			<view class="lucky-title" @click="toLuckyLt">
				<view style="font-weight: 590;">小幸运</view>
				<view>免费参与，成就值越高参与奖品越好</view>
				<view>
					<text style="vertical-align: middle;">更多</text>
					<image :src="arrow_right" style="vertical-align: middle;"></image>
				</view>
			</view>
			<view class="lucky-content">
				<view class="lucky-content-left" @click="comeLuckyDetail(item)" v-for="(item, index) in luckList" :key="item.id">
					<view class="lucky-content-contain">
						<image :src="item.main_img" mode="aspectFill"></image>
						<view class="lucky-content-tip">
							{{item.grade}}免费参与
						</view>
					</view>
					<view class="lucky-content-prize">
						<view class="lucky-prize" v-if="item.luckyPrize">奖品：{{ item.luckyPrize }}</view>
						<view class="lucky-time" v-if="item.open_type==1">{{item.openT}}自动开奖</view>
						<view class="lucky-time" v-if="item.open_type==2&&item.quota!=null">{{item.cTime}}&nbsp;满{{item.quota}}人&nbsp;自动开奖</view>
					</view>
				</view>
			</view>
		</view>
		<!-- 特权活动 -->
		<view class="home-privilege">
			<view class="privilege-title" @click="toPrivilegeLt">
				<view style="font-weight: 590;">特权活动</view>
				<view>等级越高，越多特权</view>
				<view style="margin-left: 238upx;">
					<text>更多</text>
					<image :src="arrow_right"></image>
				</view>
			</view>
			<view>
			<scroll-view  class="privilege-contain mydlsq"  @scrolltolower="loadingMore" id='mjltest'>
				<view class="privilege-content" @click="comePrivilageDetail(one.id)" v-for="(one, index) in PriviList" :key="index">
					<view class="privilege-content-left">
						<view>
							<image :src="one.img_src" style="width: 100%;height: 100%;" mode="aspectFill"></image>
						</view>
						<view style="color: #FFFFFF;background: linear-gradient(to left, #B3EA00,#00A66A);z-index: 9;">
							{{one.grade}}
						</view>
					</view>
					<view class="privilege-content-right">
						<view class="act_name">{{one.title|privi_val}}</view>
						<view v-if="isIos" style="display: flex;height: 100upx;">
							<view style="color: #999;font-size: 25upx;margin-left: 10px;">
								<button v-if="one.price>0" class="act_button_text" catchtap="" @click="toIos(one.id)">立即参与</button>
                                <button v-else  class="act_button_text" catchtap="" @click="Freetoreceive(one.id)">免费领取</button>
							</view>
						</view>
                        <view class="act_button" v-if="!isIos" >
                                <button v-if="one.price>0" class="act_button_textone" >立即参与</button>
                                <button v-else class="act_button_textone" >免费领取</button>
                        </view>
                        <view class="act_bottom" v-if="!isIos">
                        	<view class="money_icon" v-if="one.achievement_value>0"></view>
                        	<text class="money_num" v-if="one.achievement_value>0">{{one.achievement_value}}+</text><text class="money_num">￥{{one.price}}</text>
                        	<text class="old_money">￥{{one.original_price}}</text>
                        </view>
						<view class="act_tags">
							<view class="act_tag" v-if="one.share_money>0&&!isIos">
								分享赚￥{{one.share_money}}
							</view>
							<view class="act_tag" style="margin-left: 10upx;" v-if="one.share_achievement_value>0">
								成就值+{{one.share_achievement_value}}
							</view>
						</view>
						
					</view>
				</view>
			</scroll-view>
			</view>
		</view>
		<ending v-if="isdaodi"></ending>
		<!-- 授权步数弹框 -->
		<uni-popup ref="popupDelete" :custom="true">
			<view class="popup_box_des">
				<view class="popup_top_des">
					<view class="popup_title_des">打开微信运动授权，开始获取步数</view>
				</view>
				<!-- 用户操作按钮 -->
				<view class="checkDeBtnss">
					<view class="cancleDeBtns" @click="cancelScope">取消</view>
					<button open-type="openSetting" style="background-color:transparent;" class="sureDeBtns">
						确定
					</button>
				</view>
			</view>
		</uni-popup>
		<!-- 欢迎弹框 -->
		<uni-popup ref="popupWelcome" :custom="true">
			<view class="popup_box_de">
				<!-- <image class="popup_box_close" :src="clearPng" @click="popupClose"></image> -->
				<view class="popup_box_content">
					<view class="popup_box_img">
						<image :src="gift_new_img" style="width: 68upx;height: 68upx;"></image>
						<view style="margin-left: 18upx;">盘古</view>
					</view>
					<view class="popup_box_welcome">
						<view></view>
						<view>
							<text>
							<text style="color: #FFE500;align-self: flex-start;" v-if="nickName">{{nickName}}</text>
							<text style="color: #FFE500;align-self: flex-start;" v-else>你好</text>，{{homeInfo.news.welcome_message}}
							</text>
						</view>
					</view>
					<view class="popup_box_prepare">
						<view class="popup_box_contain">
							<view class="popup_box_prepare_title">
								点亮地球，特意为你准备了
							</view>
							<view class="popup_box_prepare_gift">
								<view>
									<image class="popup_box_image" :src="crown"></image>
									<text class="popup_box_prepare-num">{{homeInfo.news.achievement_value}}</text>
									<text class="popup_box_prepare-think">成就值</text>
								</view>
								<view>
									<image class="popup_box_image" :src="gift_kindling"></image>
									<text class="popup_box_prepare-num" style="font-size:28upx;text-align:center;">{{homeInfo.news.grade}}</text>
									<text class="popup_box_prepare-think">火种</text>
								</view>
								<view>
									<image class="popup_box_image" :src="gift_money"></image>
									<text class="popup_box_prepare-num">{{homeInfo.news.red_envelope}}</text>
									<text class="popup_box_prepare-think">现金红包</text>
								</view>
							</view>
						</view>
					</view>
					<!--#ifdef H5-->
					<button class='popup_box_prepare_receive' @click="getuserinfo">
						接受挑战
					</button>
					<!--#endif-->
					<!--#ifdef MP-WEIXIN-->
					<button class="popup_box_prepare_receive" open-type="getUserInfo" withCredentials="true" lang="zh_CN" @getuserinfo="getuserinfo">
						接受挑战
					</button>
					<!--#endif-->
					<view class="xieyi" @click="toMember">
						接受挑战就代表同意<text style="color: #00A66A;">《用户协议》</text>
					</view>
				</view>
			</view>
		</uni-popup>
        <!--#ifdef H5-->
        <uni-popup ref="shareTip" :custom="true">
        	<view class="popup_box_de_share">
        		<image class="popup_box_close_share" src="../../static/share_tip.png"></image>
        	</view>
        </uni-popup>
        <!--#endif-->
	</view>
</template>

<script>
	let werunIv
	let werunEncryptedData
	let werunCode
	import {
		formaHomeTime,
		formatLuckyTime,
		formatMD,
		everyWholeTime
	} from '@/common/util.js'
	import uniPopup from '@/components/uni-popup/uni-popup.vue'
	import ending from '../../common/ending.vue'

	//#ifdef H5
	import {
		userLogin
	} from '../../common/h5login.js'
	//#endif
	
	//#ifdef MP-WEIXIN
	import {
		userLogin
	} from '../../common/login.js'
	//#endif
	export default {
		//分享
		onShareAppMessage(res) {
			if(this.$store.getters.getToken) {
				return {
					title: this.homeInfo.copy_write,
					path: 'pages/home/home?share_id=' + this.$store.getters.getUserId+'&fromJin=2',
					imageUrl: this.homeInfo.image_src
				}
			}
		},
		components: {
			ending,
			uniPopup
		},
		filters: {
			privi_val(value) {
				if (!value) return ''
				if (value.length > 28) {
					return value.slice(0, 28) + '...'
				}
				return value
			}
		},
		data() {
			return {
                achiebement_value:'',
                invite1_achievement_value : '',
				inviteNum: this.$store.getters.getNum,
				hasLogin: false,
				timeId: null,
				showTime: false,
				nowTime: '00:00:00',
				nickName: '',
				avatarUrl: '',
				width: 0,
				luckList: [],
				PriviList: [],
				videoImg: this.$imgUrl + 'img/video.png',
				new_gift: this.$imgUrl + 'img/new_gift.png',
				lucky_bag: this.$imgUrl + 'img/lucky_bag%20.png',
				nomination: this.$imgUrl + 'img/nomination.png',
				arrow_right: this.$imgUrl + 'img/arrow_right.png',
				clearPng: this.$imgUrl + 'img/clear.png',
				gift_new_img: this.$imgUrl + 'img/gift_new_img.png',
				crown: this.$imgUrl + 'img/crown.png',
				gift_kindling: this.$imgUrl + 'img/gift_kindling.png',
				gift_money: this.$imgUrl + 'img/gift_money.png',
				// 需要订阅的模板id
				tmplIds: [],
				// 授权了的模板id
				templateIds: [],
				share_id: this.$store.getters.getShareId,
				fromJin: this.$store.getters.getFormJin,
				// 首页信息
				homeInfo: {
					grade: '初级火种',
					// is_new: 1, //是否是新人,1是2不是
					is_run: 1, //是否需要统计跑步,1是2不是
					user_achievement_value: 0, //用户当前成就值
					next_level_achievement_value: 0, //下一级的成就值
					light_up_city: 0,
					is_can_day: 2,//2不可以答题,1可以
					is_captain:0,//0普通成员，1是队长
					qian: 0,
					canjia: 0,
					is_notice: 1, //是否需要订阅消息1是2不是
					num: 4,
					copy_write: '',
					image_src: '',
					news: {
						welcome_message: '',
						achievement_value: 0,
						red_envelope: 0,
						grade: 0
					}
				},
				// 是否到六点了
				isSix: false,
				// 是否到五点了
				isFive: false,
				// 是否到八点了
				isEight: false,
				// 每日解谜时间倒计时
				rH: '00', //时
				rF: '00', //分
				rS: '00', //秒
				pagesize: 10,
				page: 1,
				height: 0,
				isdaodi: false, // false为未到底，true已到底
				last_pagesss: 1,
				first_height: 0,
				isIos:this.$isIos,
			}
		},
		onLoad(options) {
			if (options.share_id != undefined) {
				this.share_id = options.share_id
				this.fromJin = options.fromJin
				this.$store.commit('updataFromJin',this.fromJin)
				this.$store.commit('updataShareId', this.share_id)
				console.log('来自分享页面', options)
			}
                
		},
		onShow() {
            
			if (this.$store.getters.getToken) {
				this.hasLogin = true
				this.getuserinfo()
                
                // 邀请好友成就值获取
				this.$api.get_achievement_value({token:this.$store.getters.getToken}).then(res => {
				    if(res.status){
                        this.invite1_achievement_value = res.data.invite1_achievement_value
				    }
				}).catch(err => {
						console.log('邀请好友成就值获取', err)
					})
			}else {
				this.hasLogin = false
				setTimeout(()=>{					
					this.$refs.popupWelcome.open()
				},1)
			}
			this.getHomeInfo()
			this.getLuck()
			this.isdaodi = false
			console.log('获取列表56454584')
			this.height = parseInt(uni.getSystemInfoSync().windowHeight) - this.height
			this.getPrivilegeActList()
			// this.getmyddddd()
			this.first_height = this.height
			console.log('高度===', this.height)
			// this.loadingMore()
		},
		onHide() {
			if (this.timeId != null) {
				clearInterval(this.timeId)
				this.timeId = null
			}
			this.$refs.popupDelete.close()
			console.log(123132)
			this.height = this.first_height
		},
		onUnload() {
			if (this.timeId != null) {
				clearInterval(this.timeId)
				this.timeId = null
			}
			this.$refs.popupDelete.close()
		},
		onReady() {
			console.log('初始渲染完成..........')
			this.getKuanGao()
		},
		onReachBottom() {
			console.log('触发上拉时间')
			this.loadingMore()
		},
		methods: {
            toIos(id){
                console.log(id,'99999999999999999','-----',this.$store.state.H5URL + 'pages/welfare/welfareDetails/welfareDetails?id=' +id)
                uni.navigateTo({
                
                    url:'../welfare/welfareDetails/welfareDetails?id=' +id,
                    // url:'http://localhost:8080/pages/welfare/welfareDetails/welfareDetails?id=278'
                })
            },
            open_share_tip(){
                this.$refs.shareTip.open()
            },
			//成就值为什么重要富文本
            getrulePopup(){
                uni.navigateTo({
                    url:"./Achievementvalue/Achievementvalue"
                })
            },
			getKuanGao() {
				var _this = this;
				uni.getSystemInfo({
					success: (resu) => {
						console.log('getSystemInfo===========', resu)
						const query = uni.createSelectorQuery()
						query.select('.mydlsq').boundingClientRect()
						query.exec(function(res) {
							console.log('结果========', res)
							// _this.height = resu.windowHeight - res[0].top + 'px';
							console.log('打印页面的剩余高度', _this.height);
						})
						console.log('hahahahahahha==============')
					},
					fail: (res) => {
						console.log('失败==========', res)
					}
				})
			},
			loadingMore() {
				console.log('loadingMore=========')
				let that = this
				this.page = this.page+1
				if(this.page>this.last_page) {
					uni.showToast({
						title: '没有更多了',
						icon: 'none',
						duration: 2000
					})
					// return false
				}else {
					let data = {
						token: this.token,
						page: this.page,
						pagesize: this.pagesize
					}
					this.$api.getPrivilegedList(data).then(res => {
						if (res.status) {
							console.log('loadingMore dddddd获取特权活动数据列表', this.PriviList)
							this.PriviList = this.PriviList.concat(res.data.data)
							if (res.data.current_page == res.data.last_page) {
								this.isdaodi = true
							}
							// console.log('ddddddddddd', this.height)
							// if (res.data.data.length < this.pagesize) {
							// 	var pp = this.pagesize - res.data.data.length;
							// 	this.height = this.height - (278 * pp);
							// }
						} else {
							uni.showToast({
								title: res.msg,
								icon: 'none',
								duration: 2000
							})
						}
					}).catch(err => {
						console.log('获取特权活动数据列表', err)
					})
				}
			},
			toMember() {
				console.log('hhhhhhhhhhhhh')
				uni.navigateTo({
					url:'../memberCenter/menberJurisdiction/menberJurisdiction?page=jurisdictionExplain'
				})
			},
			// 获取首页用户基本信息
			getHomeInfo() {
				console.log("获取首页用户基本信息111",this.$store)
				let self = this
				let data = {
					user_id: self.$store.getters.getUserId
				}
				this.$api.getHomeBase(data).then(res => {
					if (res.status) {
						self.homeInfo = res.data
						self.width = (self.homeInfo.user_achievement_value / self.homeInfo.next_level_achievement_value).toFixed(2) *
							100
						self.width > 100 ? self.width = 100 : self.width = self.width
						self.getNowTime(res.data.income.time)
						
						// #ifdef H5
						// H5分享
						let link = this.$store.state.H5URL+'pages/home/home?share_id=' + this.$store.getters.getUserId+'&fromJin=2'
						let share_detail = '首页分享详情'
						this.share(this.homeInfo.copy_write,share_detail,this.homeInfo.image_src,link=link)
						// #endif
					}
					console.log('获取首页用户基本信息', res)
				}).catch(err => {
					console.log('获取首页用户基本信息', err)
				})
			},
			// 订阅消息
			subscribeNews() {
				let self = this
				if (self.$store.getters.getToken) {
					let data = {
						token: self.$store.getters.getToken,
						type: 1
					}
					self.$api.get_wx_news(data).then(res => {
						if (res.status) {
							self.tmplIds = res.data
							uni.requestSubscribeMessage({
								tmplIds: self.tmplIds,
								success(res) {
									let arr = []
									for (var p in res) {
										if (res[p] == 'accept') {
											arr.push(p)
										}
									}
									self.templateIds = arr
									console.log('授权了的模板id有', arr)
									self.tellManageTmpIds()
								},
								fail(err) {
									console.log('订阅消息fail', err)
								}
							})
							console.log('订阅消息数据模板id', res)
						}
					}).catch(err => {
						console.log('订阅消息数据模板id', err)
					})
				} else {
					uni.showToast({
						title: '请先登录',
						icon: 'none',
						duration: 2000
					})
				}
			},
			// 告知后台订阅的模板id有哪些
			tellManageTmpIds() {
				let self = this
				let temp = self.templateIds.join(',')
				let data = {
					token: self.$store.getters.getToken,
					templateIds: temp,
					isNoNeedLoading: true
				}
				self.$api.get_wx_news_result(data).then(res => {
					if(res.status) {
						self.getHomeInfo()
					}
					console.log('小程序授权模板告知', res)
				}).catch(err => {
					console.log('小程序授权模板告知', err)
				})
			},
			getNowTime(time) {
				if(this.timeId!=null) {
					clearInterval(this.timeId)
					this.timeId=null
				}
				this.timeId = setInterval(() => {
					var now = new Date().getTime();
					var dis = time*1000-now
					if(dis>0&&dis<(72*60*60*1000)) {//小于72小时显示
						let day = Math.floor(dis / (1000 * 60 * 60 * 24));
						let hour = Math.floor((dis % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
						let minute = Math.floor((dis % (1000 * 60 * 60)) / (1000 * 60));
						let second = Math.floor((dis % (1000 * 60)) / 1000);
						let h = (day*24+hour)>=10?(day*24+hour):'0'+(day*24+hour);
						let f = minute>=10?minute:'0'+minute;
						let s = second>=10?second:'0'+second;
						this.nowTime = h+':'+f+':'+s
						this.showTime = true
					}else {
						this.showTime = false
						this.nowTime = '00:00:00'
					}
					
					let a = new Date().getTime() - everyWholeTime('06')
					let b = new Date().getTime() - everyWholeTime('08')
					let c = new Date().getTime() - everyWholeTime('05')
					a >= 0 ? this.isSix = true : this.isSix = false
					b >= 0 ? this.isEight = true : this.isEight = false,
					c >= 0 ? this.isFive = true : this.isFive = false
					if (b >= 0) { //过了8点
						this.rH = '00'
						this.rF = '00'
						this.rS = '00'
					} else {
						let distance = everyWholeTime('08')- new Date().getTime()
						var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
						var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
						var seconds = Math.floor((distance % (1000 * 60)) / 1000);
						this.rH = hours>=10?hours.toString():'0'+hours.toString();
						this.rF = minutes>=10?minutes.toString():'0'+minutes.toString();
						this.rS = seconds>=10?seconds.toString():'0'+seconds.toString();
					}
				}, 1000)
                this.timeIdone = setInterval(() => {
                	var now = new Date().getTime();
                	var dis = time*1000-now
                	if(dis>0&&dis<(72*60*60*1000)) {//小于72小时显示
                		let day = Math.floor(dis / (1000 * 60 * 60 * 24));
                		let hour = Math.floor((dis % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
                		let minute = Math.floor((dis % (1000 * 60 * 60)) / (1000 * 60));
                		let second = Math.floor((dis % (1000 * 60)) / 1000);
                		let h = (day*24+hour)>=10?(day*24+hour):'0'+(day*24+hour);
                		let f = minute>=10?minute:'0'+minute;
                		let s = second>=10?second:'0'+second;
                		this.nowTime = h+':'+f+':'+s
                		this.showTime = true
                	}else {
                		this.showTime = false
                		this.nowTime = '00:00:00'
                	}
                	
                	let a = new Date().getTime() - everyWholeTime('06')
                	let b = new Date().getTime() - everyWholeTime('22')
                	let c = new Date().getTime() - everyWholeTime('06')
                	a >= 0 ? this.isSix = true : this.isSix = false
                	b >= 0 ? this.isEight = true : this.isEight = false,
                	c >= 0 ? this.isFive = true : this.isFive = false
                	if (b >= 0) { //过了22点
                		this.rH = '00'
                		this.rF = '00'
                		this.rS = '00'
                	} else {
                		let distance = everyWholeTime('08')- new Date().getTime()
                		var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
                		var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
                		var seconds = Math.floor((distance % (1000 * 60)) / 1000);
                		this.rH = hours>=10?hours.toString():'0'+hours.toString();
                		this.rF = minutes>=10?minutes.toString():'0'+minutes.toString();
                		this.rS = seconds>=10?seconds.toString():'0'+seconds.toString();
                	}
                }, 1000)
			},
			async getuserinfo() {
				this.popupClose()
				//#ifdef H5
				// let redirect_url=location.href
				// let agr={this.share_id,this.fromJin}
				await userLogin(this.share_id,this.fromJin)
				try {
					const res = uni.getStorageSync('userInfo');
					console.log("userInfo",res)
					if (res) {
						this.nickName = res.nickName
						this.avatarUrl = res.avatarUrl
					}
				} catch (e) {
					this.nickName = this.$store.state.nickName
					this.avatarUrl = this.$store.state.avatarUrl
				}
				this.hasLogin = true
				this.getHomeInfo()
				//#endif
				//#ifdef MP-WEIXIN
				userLogin(this.share_id,this.fromJin)		
				setTimeout(()=>{
					try {
						const res = uni.getStorageSync('userInfo');
						console.log("userInfo",res)
						if (res) {
							this.nickName = res.nickName
							this.avatarUrl = res.avatarUrl
						}
					} catch (e) {
						this.nickName = this.$store.state.nickName
						this.avatarUrl = this.$store.state.avatarUrl
					}
					this.hasLogin = true
					this.getHomeInfo()
				},2000)
				//#endif
			
			},
			
			// 点击获取新人礼包
			getNewGift() {
				let self = this
				uni.getSetting({
					success(res) {
						console.log('hhhhhhhhhhhhh',res)
						if (res.authSetting['scope.userInfo']) {
							if (self.$store.getters.getToken) {
								self.$refs.popupWelcome.open()
							} else {
								self.getuserinfo()
								setTimeout(() => {
									self.$refs.popupWelcome.close()
								}, 3000)
							}
						}
					},
					fail(err) {
						console.log(err)
					}
				})
			},
			// 微信授权
			userWerun(){
				let self = this
				uni.login({
					provider:"weixin",
					success(res) {
						werunCode = res.code
						uni.authorize({
						    scope: 'scope.werun',
						    success(res) {
								wx.getWeRunData({
									success(res) {
										console.log('获取步数数据success',res)
										werunIv = res.iv
										werunEncryptedData = res.encryptedData
										self.testWerun()
									},
									fail(err) {
										self.$refs.popupDelete.open()
									}
								})
						    },
							fail(err) {
								self.$refs.popupDelete.open()
							}
						})
					}
				})
			},
			// 获取步数
			testWerun(){
				let self = this
				let data={
					code: werunCode,
					iv: werunIv,
					encryptedData: werunEncryptedData,
					token: self.$store.getters.getToken
				}
				self.$api.get_run_steps(data).then(res=>{
					if(res.status) {
						if(res.step.step>=3000) {
							self.getHomeInfo()
						}else {
							uni.showToast({
								title: '您今日还没达到3000步哦！',
								icon: 'none',
								duration: 3000
							})
						}
						console.log('获取用户的步数成功',res)
					}else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						})
					}
				}).catch(err=>{
					console.log('获取用户的步数失败',err)
				})
			},
			// 点击步数
			addStepNum() {
				let self = this
				uni.getSetting({
					success(res) {
						if (res.authSetting['scope.userInfo']) {
							if (self.$store.getters.getToken) {
								self.userWerun()
							} else {
								self.getuserinfo()
								// setTimeout(() => {
								// 	self.userWerun()
								// }, 3000)
							}
						}
					},
					fail(err) {
						console.log(err)
					}
				})
			},
			// 取消授权
			cancelScope() {
				this.$refs.popupDelete.close()
			},
			popupClose() {
				setTimeout(()=>{
					this.$refs.popupWelcome.close()
				},1)
			},
			// 获取小幸运数据
			getLuck() {
				const that=this
				let data = {
					pagesize: 2,
					token: that.$store.getters.getToken
				}
				that.$api.get_all_start_lucky(data).then(res => {
					if (res.status) {
						that.luckList = res.list.data
						for (let i = 0; i < res.list.data.length; i++) {
							let time = res.list.data[i].open_time
							res.list.data[i].openT = formatLuckyTime(time)
							res.list.data[i].cTime = formatMD(res.list.data[i].start_time)
							let str = []
							for (let j = 0; j < res.list.data[i].prize.length; j++) {
								str.push(res.list.data[i].prize[j].prize)
							}
							res.list.data[i].luckyPrize = str.join(',')
						}
						
						
					}
				}).catch(err => {
					console.log(err)
				})
			},
			// 获取特权活动数据列表
			getPrivilegeActList() {
				this.page = 1;
				let data = {
					page: 1,
					pagesize: this.pagesize,
					token: this.$store.getters.getToken
					}
					this.$api.getPrivilegedList(data).then(res => {
								
						this.PriviList = res.data.data
						console.log('sssssssssss获取特权活动数据列表', this.PriviList)
						console.log('onshou获取特权活动数据列表', res.data)
			                      
									
						if (res.data.current_page == res.data.last_page) {
							this.isdaodi = true
						}
						var lent = parseInt(uni.getSystemInfoSync().windowHeight) 
						console.log('sdfdsfds', lent)
						console.log('sdfdsfds', this.height)
						if(res.data.current_page == 1 && !res.data.data.length) { // 第一页没有数据,清零
						console.log('清零')
						this.height = 0
						} else if(!this.height){
							this.height = lent - this.height
						} else if (lent < this.height) {
							this.height = lent
						}
						console.log('res.data.data.length', res.data.data.length)
						console.log('this.pagesize', this.pagesize)
						if (res.data.data.length < this.pagesize) {
							var pp = this.pagesize - res.data.data.length;
							this.height = this.height - (278 * pp);
							}
								 else {
									uni.showToast({
										title: res.msg,
										icon: 'none',
										duration: 2000
									})
								}
			                    
							}).catch(err => {
								console.log('获取特权活动数据列表', err)
							})
						},
			riddleClick() {
				let self = this
				//#ifdef H5
				if (self.$store.getters.getToken) {
					if (self.homeInfo.is_can_day == 1) {
						uni.navigateTo({
							url: '../riddle/riddle'
						})
					} else {
						uni.navigateTo({
							url: '../riddle/luckyCard/luckyCard'
						})
					}
				} else {
					self.getuserinfo()
					if (self.homeInfo.is_can_day == 1) {
						uni.navigateTo({
							url: '../riddle/riddle'
						})
					} else {
						uni.navigateTo({
							url: '../riddle/luckyCard/luckyCard'
						})
					}
				}
				//#endif
				
				//#ifdef MP-WEIXIN
				// if (this.isFive == true && this.isEight == false) {
					uni.getSetting({
						success(res) {
							console.log(res)
							if (res.authSetting['scope.userInfo']) {
								if (self.$store.getters.getToken) {
									if (self.homeInfo.is_can_day == 1) {
										uni.navigateTo({
											url: '../riddle/riddle'
										})
									} else {
										uni.navigateTo({
											url: '../riddle/luckyCard/luckyCard'
										})
									}
								} else {
									self.getuserinfo()
									setTimeout(() => {
										if (self.homeInfo.is_can_day == 1) {
											uni.navigateTo({
												url: '../riddle/riddle'
											})
										} else {
											uni.navigateTo({
												url: '../riddle/luckyCard/luckyCard'
											})
										}
									}, 1000)
								}
							}
						},
						fail(err) {
							console.log(err)
						}
					})
				// } else {
				// 	if(self.homeInfo.is_can_day == 2) {
				// 		uni.navigateTo({
				// 			url: '../riddle/luckyCard/luckyCard'
				// 		})
				// 	}else{
				// 		uni.showToast({
				// 			title: '答题时间为早上五点到八点！',
				// 			icon: 'none',
				// 			duration: 2000
				// 		})
				// 	}
				// }
				//#endif
				
			},
			// 进入我的世界
			toMyWorld() {
				let self = this
				uni.getSetting({
					success(res) {
						console.log('hhhhhhhhhhhhh',res)
						if (res.authSetting['scope.userInfo']) {
							if (self.$store.getters.getToken) {
								uni.navigateTo({
									url: '../myWorld/myWorld'
								})
							} else {
								self.getuserinfo()
								// setTimeout(() => {
								// 	uni.navigateTo({
								// 		url: '../myWorld/myWorld'
								// 	})
								// }, 3000)
							}
						}
					},
					fail(err) {
						console.log(err)
					}
				})
			},
			// 点击金榜题名
			topNominateClick() {
                // if(this.homeInfo.is_can_day == 1){
                    uni.navigateTo({
                    	url: './topNominate/topNominate'
                    })
                // }else{
                //         uni.showToast({
                //             title: '答题时间为早上6点到22点！',
                //             icon: 'none',
                //             duration: 2000
                //         })
                //     }
				
			},
			comeLuckyDetail(item) {
				uni.navigateTo({
					url: '../smallLuckydetail/luckyJoinDetail?id=' + item.id
				})
			},
			// 跳转到特权详情页
			comePrivilageDetail(id) {
				uni.navigateTo({
					url: '../welfare/welfareDetails/welfareDetails?id=' + id
				})
			},
			// 跳转到特权活动页
			toPrivilegeLt() {
				uni.navigateTo({
					url: '../welfare/moreList?index=1'
				})
			},
			// 跳转到小幸运页面
			toLuckyLt() {
				uni.navigateTo({
					url: '../welfare/moreList?index=0'
				})
			},
            //跳转到团好课页面
            Massofgoodlesson() {
                wx.navigateToMiniProgram({
                    appId:'wx218aa00c00973e41',
                    path:"/pages/index/index",
                    success(res) {
                      console.log('打开成功',"/pages/index/index")
                    }
                      
                })
            },
            //跳转特权活动详情页面
            Freetoreceive(id){
                uni.navigateTo({
                    url: '../welfare/welfareDetails/welfareDetails?id=' + id
                })
            }
            
		}
	}
</script>

<style scoped>
	.xieyi {
		color: #AAA;
		font-size: 28upx;
		text-align: center;
	}
	.top_banner {
		width: 100%;
		height: 88upx;
		background-color: rgb(240, 250, 244, 0.5);
		z-index: 3;
		display: flex;
		color: #00A66A;
		padding-left: 60upx;
		padding-right: 20upx;
		box-sizing: border-box;
		align-items: center;
		font-size: 28upx;
		justify-content: space-between;
	}

	.top_banner>view:first-child {
		height: 60upx;
		line-height: 60upx;
	}

	.top_banner>view:last-child {
		width: 160upx;
		height: 60upx;
		line-height: 60upx;
		text-align: center;
		background: linear-gradient(#CBEC00, #00A66A);
		color: #fff;
		border-radius: 40upx;
	}

	.botline {
		width: 100%;
		height: 54upx;
		border-radius: 20upx;
		background: rgba(0, 166, 106, 0.15);
		border: 1px solid #00A66A;
		padding-top: 4upx;
		box-sizing: border-box;
	}

	.topline {
		background: #FFE400;
		border-radius: 0 200upx 200upx 0;
		height: 42upx;
	}

	.no-login {
		display: flex;
	}

	.no-login>view:first-child {
		width: 70upx;
		height: 70upx;
		border-radius: 50%;
		background: #000000;
		text-align: center;
		opacity: 0.2;
		position: relative;
		top: 0%;
		left: 0%;
	}

	.no-login .bottom {
		font-size: 24upx;
		color: #00A66A;
		background: none;
		padding: 0;
		margin-left: 10upx;
	}

	.no-login .bottom:after {
		border: none;
	}

	/* 弹框样式 */
	.popup_box_de {
		height: 962upx;
		width: 590upx;
		position: relative;
		color: #fff;
	}

	.popup_box_de .popup_box_close {
		width: 52upx;
		height: 52upx;
		position: absolute;
		top: 0;
		right: 0;
	}

	.popup_box_de .popup_box_content {
		width: 590upx;
		height: 950upx;
		position: absolute;
		top: 62upx;
		left: 0;
		background: url('https://lightplanet.tuanhaoke.cn/img/new_person_bg.png');
		background-size: 100% 100%;
	}

	.popup_box_content .popup_box_img {
		display: flex;
		line-height: 68upx;
		font-size: 30upx;
		margin-left: 34upx;
		margin-top: 34upx;
	}

	.popup_box_content .popup_box_welcome {
		width: 518upx;
		height: 100upx;
		margin-top: 8upx;
		margin-left: 34upx;
	}

	.popup_box_content .popup_box_welcome>view:first-child {
		border-color: transparent transparent rgba(67, 67, 67, 0.32) transparent;
		border-style: solid;
		border-top: transparent;
		border-width: 8px;
		font-size: 0;
		height: 0px;
		line-height: 0;
		width: 0px;
		margin-left: 48px;
	}

	.popup_box_content .popup_box_welcome>view:last-child {
		height: 80upx;
		background: rgba(67, 67, 67, 0.32);
		color: #fff;
		font-size: 24upx;
		padding: 8upx 26upx;
		box-sizing: border-box;
		border-radius: 20upx;
		line-height: 34upx;
		display: flex;
		word-break: break-all;
		align-items: center;
	}

	.popup_box_content .popup_box_prepare {
		width: 564upx;
		height: 440upx;
		background-size: 50% 50%;
		margin-top: 12upx;
		background: url('https://lightplanet.tuanhaoke.cn/img/gift_decorate.png') no-repeat;
		padding-top: 10upx;
		padding-left: 28upx;
		box-sizing: border-box;
	}

	.popup_box_prepare .popup_box_contain {
		width: 100%;
		height: 570upx;
	}

	.popup_box_contain .popup_box_prepare_title {
		line-height: 52upx;
		color: #00A66A;
		font-size: 38upx;
		margin-top: 68upx;
		text-align: center;
		font-weight: 550;
	}

	.popup_box_contain .popup_box_prepare_gift {
		display: flex;
		justify-content: space-around;
		margin-top: 66upx;
	}

	.popup_box_contain .popup_box_prepare_gift .popup_box_image {
		width: 100upx;
		height: 100upx;
	}

	.popup_box_contain .popup_box_prepare_gift text {
		display: block;
		text-align: center;
	}

	.popup_box_prepare_gift .popup_box_prepare-num {
		color: #FF5C46;
		font-size: 36upx;
		line-height: 50upx;
	}

	.popup_box_prepare_gift .popup_box_prepare-think {
		font-size: 24upx;
		color: #999999;
	}

	.popup_box_content .popup_box_prepare_receive {
		height: 80upx;
		width: 430upx;
		background: linear-gradient(#CBEC00, #00A66A);
		box-shadow: 0 8upx 16upx 0 rgba(0, 166, 106, 0.4);
		color: #fff;
		font-size: 30upx;
		border-radius: 40upx;
		margin: 30upx auto;
		line-height: 80upx;
		text-align: center;
		margin-top: 0;
	}

	/* page {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
	} */

	.home {
		width: 100%;
		height: 100%;
		background-color: #F5F5F5;
	}

	.home .person-bg-img .home-person {
		width: 100%;
		height: 736upx;
		background: url(https://lightplanet.tuanhaoke.cn/img/bg-img.png) no-repeat;
		background-size: 78% 75%;
		background-position: 90upx 20upx;
		padding-left: 30upx;
		padding-top: 30upx;
		padding-bottom: 40rpx;
		box-sizing: border-box;
	}

	.home .person-bg-img {
		width: 100%;
		height: 736upx;
		background-color: #FFFFFF;
		position: relative;
	}

	.person-bg-img .person-msg {
		display: flex;
		justify-content: space-between;
	}

	.person-bg-img .person-msg .person-level {
		width: 274upx;
		height: 90upx;
		display: flex;
	}

	.person-level .person-img>image {
		width: 70upx;
		height: 70upx;
		border-radius: 50%;
	}

	.person-level .person-img {
		width: 70upx;
		height: 70upx;
		position: relative;
		z-index: 2;
	}

	.person-level .person-img>text {
		display: inline-block;
		width: 32upx;
		height: 32upx;
		line-height: 32upx;
		background: #00CEFF;
		color: #fff;
		border: 1px solid #fff;
		border-radius: 50%;
		font-size: 18upx;
		text-align: center;
		position: absolute;
		top: 40upx;
		left: 40upx;
	}

	.person-level .empirical-value {
		width: 200upx;
		height: 100%;
		margin-top: 10upx;
		margin-left: -25upx;
	}

	.person-level .empirical-value .empirical {
		width: 200upx;
		height: 54upx;
		padding: 4upx 0;
		box-sizing: border-box;
		border-radius: 25upx;
		position: relative;
	}

	.person-level .empirical-value .empirical>text {
		color: #00A66A;
		line-height: 34upx;
		font-size: 24upx;
		position: absolute;
		top: 14upx;
		left: 40upx;
		display: inline-block;
		font-family: Helvetica;
		font-weight: 800;
	}

	.person-level .empirical-value .level {
		/* width: 96upx; */
		height: 34upx;
		color: #00A66A;
		font-size: 24upx;
		margin-left: 40upx;
		margin-top: 6upx;
	}

	.person-bg-img .person-msg .open-msg {
		height: 80upx;
		width: 150upx;
		position: relative;
	}

	.person-bg-img .person-msg .open-msg>text {
		display: block;
		width: 140upx;
		height: 50upx;
		background: rgba(0, 0, 0, 0.5);
		color: #fff;
		border-radius: 8upx;
		text-align: center;
		line-height: 50upx;
		font-size: 24upx;
		margin-top: 15upx;
	}

	.person-bg-img .person-msg .open-msg>image {
		width: 26upx;
		height: 26upx;
		position: absolute;
		top: -4upx;
		right: 6upx;
	}

	.person-msg .light-city {
		width: 210upx;
		height: 50upx;
		line-height: 50upx;
		border: 1px solid rgba(0, 166, 106, 1);
		background: rgba(0, 166, 106, 0.15);
		font-size: 24upx;
		color: rgba(0, 166, 106, 1);
		text-align: center;
		border-top-left-radius: 44upx;
		border-bottom-left-radius: 44upx;
		margin-top: 10upx;
		margin-left: 244upx;
	}

	.home .person-main {
		/* width: 100%; */
		height: 64%;
		display: flex;
		padding-right: 30upx;
		position: relative;
	}

	/* .person-main .video-gift {
		width: 15%;
		height: 100%;
		padding-top: 64upx;
		box-sizing: border-box;
	} */

	.person-main .step-number {
		width: 19%;
		/* height: 100%; */
		padding-top: 140upx;
		box-sizing: border-box;
		position: absolute;
		right: 20upx;
	}

	.video-gift .video .video-img {
		width: 100upx;
		height: 100upx;
		background: url(https://lightplanet.tuanhaoke.cn/img/background_img.png);
		background-size: cover;
		border-radius: 50%;
		padding-top: 20upx;
		padding-left: 4upx;
		box-sizing: border-box;
	}

	.video-gift .gift .gift-img,
	.step-number .gift-img {
		width: 100upx;
		height: 100upx;
		background: url(https://lightplanet.tuanhaoke.cn/img/background_img.png);
		background-size: cover;
		box-sizing: border-box;
		color: #00A66A;
	}

	.gift-img {
		padding-top: 24upx;
		padding-right: 16upx;
	}

	.button_father {
		padding-top: 28upx;
	}

	.video-gift .gift .gift-img {
		padding-top: 22upx;
		padding-right: 4upx;
	}

	.person-main .person-achievement {
		width: 66%;
		height: 90%;
		text-align: center;
		color: #fff;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		box-sizing: border-box;
		padding-top: 64upx;
		padding-bottom: 46upx;
		position: absolute;
		left: 50%;
		transform: translateX(-50%);
	}

	.home-person .invite-new {
		width: 100%;
		height: 134upx;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-between;
		padding-right: 30rpx;
		box-sizing: border-box;
	}

	.invite-new .gain-Achievement {
		width: 430upx;
		color: #fff;
		font-size: 30upx;
		text-align: center;
		line-height: 80upx;
		background: linear-gradient(#CBEC00, #00A66A);
		box-shadow: 0 8upx 16upx 0 rgba(0, 166, 106, 0.4);
		border-radius: 40upx;
	}

	.invite-new .enjoy-privilege {
		font-size: 24upx;
		line-height: 34upx;
		color: rgba(0, 166, 106, 0.8);
		font-weight: 600;
	}

	/* 每日解谜与金榜题名 */
	.riddle-nominate {
		width: 100%;
		height: 310upx;
		display: flex;
		justify-content: space-between;
		margin-top: 20upx;
        
	}

	.riddle-nominate .riddle {
		width: 236upx;
		background: #fff;
		padding: 20upx 20upx 20upx 0upx;
		box-sizing: border-box;
		text-align: center;
		border-radius: 0;
	}

	/* 每日解谜 */
	.riddle-nominate .riddle .riddle-title {
		line-height: 48upx;
		margin: 0 auto;
		color: #333333;
		font-size: 24upx;
		font-weight: 600;
        position: relative;
        margin-left: 30upx;
       
	}

	.riddle-nominate .riddle .riddle-time {
		line-height: 34upx;
		font-size: 20upx;
		color: #FF3C00;
        margin-left: 28upx;
	}

	.riddle-nominate .riddle .riddle-congratulate {
		font-size: 24upx;
        line-height: 10upx;
        position: absolute;
        margin-left: 30upx;
        font-weight: 800;
        flex-direction:column;
	}
    .riddle-nominate .riddle .riddle-congratulateone{
        margin-top: 36upx;
    }
    

	.riddle-nominate .riddle .riddle-person {
		color: #999999;
		font-size: 18upx;
		line-height: 60upx;
        margin-bottom: 5upx;
        margin-left: 30upx;
        flex-direction:column;
	}
    .riddle-nominate .riddle .riddle-personone{
        margin-top: 36upx;
    }

	.riddle-nominate .suspend {
		position: relative;
		height: 160upx;
		width: 176upx;
		margin: 0 auto;
	}

	.riddle-nominate .suspend .riddle-nominate-img {
		width: 126upx;
		height: 114upx;
        padding-top: 6upx;
        margin-top: 40upx;
	}

	.riddle-nominate .suspend .suspend-title {
		width: 132upx;
		height: 48upx;
		background: url(https://lightplanet.tuanhaoke.cn/img/nomination_bg.png);
		background-size: 100% 100%;
		color: #FFFFFF;
		font-size: 24upx;
		text-align: center;
		position: absolute;
		line-height: 45upx;
		top: 28upx;
		right: -37upx;
        margin-top: 40upx;
	}
    .riddle-nominate .suspend .suspeend-titleone{
       margin-top: 0upx;
    }

	.riddle-nominate .nominate-img {
		width: 126upx;
		height: 114upx;
        padding-top: 20upx;
        padding-left: 20upx;
	}
    /*团好课*/
    .riddle .padding{
        padding: 66upx 38upx 66upx 40upx;
        position: relative;
    }
    
    .riddle .Massofgoodlesson{
        position: absolute;
    }
    .riddle .Massofgoodlesson-img{
        position: absolute;
        width: 158upx;
        height: 158upx;
        top: 25upx;
        left: 24upx;
        
 
     }
     .riddle .Massofgoodlessonteacher{
         position: absolute;
         top: 200upx;
         font-size: 24upx;
         font-weight: 800;
         left: 46upx;
     }
	/* 小幸运 */
	.home-lucky {
		width: 100%;
		/* height: 528upx; */
		background: #FFFFFF;
		margin-top: 20upx;
		padding: 26upx 30upx 40upx 30upx;
		box-sizing: border-box;
	}
    .home-privilege{
       overflow-x: hidden; overflow-y: auto; 
    }
	.home-lucky .lucky-title,
	.home-privilege .privilege-title {
		display: flex;
	}

	.lucky-title>view:first-child,
	.privilege-title>view:first-child {
		font-size: 34upx;
		color: #333;
		line-height: 48upx;
	}

	.lucky-title>view:nth-child(2),
	.privilege-title>view:nth-child(2) {
		color: #999;
		font-size: 24upx;
		line-height: 34upx;
		margin-top: 8upx;
		margin-left: 16upx;
	}

	.lucky-title>view:last-child,
	.privilege-title>view:last-child {
		color: #999;
		font-size: 24upx;
		line-height: 34upx;
		margin-top: 4upx;
		margin-left: 105upx;
	}

	.lucky-title>view>image,
	.privilege-title>view>image {
		width: 10upx;
		height: 18upx;
		margin-left: 16upx;
		margin-top: 2upx;
	}

	.home-lucky .lucky-content {
		width: 100%;
		height: 100%;
		display: flex;
		justify-content: space-between;
		padding-top: 24upx;
		box-sizing: border-box;
	}

	.lucky-content .lucky-content-left {
		width: 332upx;
		height: 100%;
		background: none;
	}

	.lucky-content .lucky-content-left .lucky-content-contain {
		width: 100%;
		height: 250upx;
		position: relative;
	}

	.lucky-content-contain>image {
		width: 100%;
		height: 100%;
	}

	.lucky-content .lucky-content-right-img {
		background: url(https://lightplanet.tuanhaoke.cn/img/advanced_lucky.png);
		background-size: 100% 100%;
	}

	.lucky-content .lucky-content-contain .lucky-content-tip {
		width: 236upx;
		height: 50upx;
		line-height: 50upx;
		background: url(https://lightplanet.tuanhaoke.cn/img/lucky_bg.png);
		background-size: 100% 100%;
		font-size: 24upx;
		color: #fff;
		text-align: center;
		position: absolute;
		bottom: 0;
		left: 0;
	}

	.lucky-content-left .lucky-prize {
		width: 320upx;
		font-size: 30upx;
		word-break: break-all;
		color: #333;
		text-align: left;
		line-height: 42upx;
		margin-top: 12upx;
	}

	.lucky-content-left .lucky-time {
		line-height: 34upx;
		font-size: 24upx;
		color: #FF3C00;
		margin-top: 10upx;
		text-align: left;
	}

	/* 特权活动 */
	.home-privilege {
		width: 100%;
		background: #fff;
		margin-top: 20upx;
		padding: 26upx 30upx 32upx 30upx;
		box-sizing: border-box;
	}

	.home-privilege .privilege-contain {
		margin-top: 24upx;
	}

	.home-privilege .privilege-contain .privilege-content {
		width: 100%;
		height: 258upx;
		border-bottom: 1px solid rgba(0, 0, 0, 0.12);
		padding-bottom: 28upx;
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;
		margin-top: 32upx;
	}

	.home-privilege .privilege-contain .privilege-content:last-child {
		border-bottom: none;
	}

	.privilege-content-left {
		width: 240upx;
		height: 230upx;
		position: relative;
	}

	.privilege-content-left>view:first-child {
		width: 100%;
		height: 100%;
	}

	.privilege-content-left>view:last-child {
		font-family: PingFangSC-Medium;
		width: 100%;
		height: 50upx;
		font-size: 24upx;
		text-align: center;
		line-height: 50upx;
		/* opacity: 0.7; */
		background-color: rgba(0, 0, 0, 1);
		position: absolute;
		bottom: 0;
		left: 0;
	}

	.privilege-content-right {
		width: 430upx;
		height: 100%;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}

	.act_name {
		color: #333;
		font-size: 30upx;
		height: 84upx;
	}

	.act_tags {
		color: #FF3C00;
		text-align:center;
		vertical-align:middle;
		font-size: 29upx;
		display: flex;
	}

	.act_tag {
        line-height: 46upx;
        font-size: 26upx;
        padding: 0 20upx ;
		height:46upx;
		border-radius:12px;
		border:1px solid rgba(255,60,0,1);
	}

	.act_bottom {
		display: flex;
		align-items: center;
	}

	.old_money {
		color: #cccccc;
		font-size: 24upx;
		text-decoration: line-through;
		line-height: 34upx;
		margin-top: 6upx;
	}

	.money_num {
		color: #FF3C00;
		font-size: 32upx;
	}

	.money_icon {
		width: 32upx;
		height: 32upx;
		margin-right: 4upx;
		background: url('https://lightplanet.tuanhaoke.cn/img/crown.png') no-repeat;
		background-size: 100% 100%;
	}

	.popup_box_des {
		width: 640upx;
		height: 240upx;
		border-radius: 24upx;
		background-color: #fff;
		font-size: 34upx;
	}

	.popup_top_des {
		width: 100%;
		height: 160upx;
		box-sizing: border-box;
		padding: 54upx 0upx;
		border-bottom: 1upx solid rgba(0, 0, 0, 0.1);
	}

	.popup_title_des {
		color: #353535;
		text-align: center;
	}

	.checkDeBtnss {
		height: 80upx;
		display: flex;
		color: #666;
	}

	.sureDeBtns {
		width: 50%;
		height: 100%;
		color: #00A66A;
		text-align: center;
		line-height: 80upx;
	}

	.cancleDeBtns {
		width: 50%;
		height: 100%;
		text-align: center;
		line-height: 80upx;
		border-right: 1upx solid rgba(0, 0, 0, 0.1);
	}
	
	.act_button{
        z-index: 777;
		width:190upx;
		height:60upx;
		position: absolute;
		text-align: center;
		vertical-align:middle;
		background:linear-gradient(180deg,rgba(179,234,0,1) 0%,rgba(0,166,106,1) 100%);
		box-shadow:0px 2px 4px 0px rgba(0,166,106,0.35);
		border-radius:30upx;
		right: 15upx;
        margin-top: 88upx;
        margin-right: -14upx;
	}
	.act_button_textone{
        width: 180upx;
        height: 60upx;
        background:linear-gradient( to top,#00A66A,#CBEC00) ;
        border-radius: 30upx;
        line-height: 60upx;
        font-size: 30upx;
        color:rgba(255,255,255,1);
        text-align: center;
        
	}
    .act_button_text{
        width: 180upx;
        height: 60upx;
        background:linear-gradient( to top,#00A66A,#CBEC00) ;
        border-radius: 30upx;
        line-height: 60upx;
        font-size: 30upx;
        color:rgba(255,255,255,1);
        text-align: center;
        margin-left: 230upx;
    }
    // 分享提示
    .popup_box_de_share{
    	width: 100%;
    	height: 100%;
    }
    .popup_box_close_share{
     	width: 300upx;
     	height: 300upx;
     	position: fixed;
     	top: 10upx;right: 10upx;
    }
</style>
